// Lang_09 [creating classes].nova // The application class. class CreatingClassesApp { // Application class's "main" function. public static void main( String[] args ) { // Create an instance of the first class. First first = new First( ); // Call the "method1" instance method of the first object. first.method1( ); } } class First { // Declare an instance attribute. private Second second; // Constructor method. public First( ) { Stream.writeLine( "Constructor 'First( )' called" ); // Initialize the instance attribute. second = new Second( ); // Create an instance of the second class. } // Instance method (not static). public void method1( ) { Stream.writeLine( "First.method1( ) called" ); // Call a method of the "Second" class. second.method1( ); } } class Second { // Constructor method. public Second( ) { Stream.writeLine( "Constructor 'Second( )' called" ); } // Instance method (not static). public void method1( ) { Stream.writeLine( "Second.method1( ) called" ); } }